package com.sdppf.dao.impl;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.sdppf.dao.PageContentDao;

public class PageContentDaoImpl<T> extends HibernateDaoSupport implements PageContentDao<T> {

	@Override
	public Iterable<T> GetList(int index,String hql,int pageContainNumber) {
		System.out.println(((Integer)index).toString()+hql+((Integer)pageContainNumber).toString());
		
		Session session = this.getSession();
		System.out.println("session ok");
		

		Iterable<T> allList = session.createQuery(hql).setFirstResult(index*pageContainNumber).setMaxResults(pageContainNumber).list();
		this.releaseSession(session);
		return allList;
		
	}
	public PageContentDaoImpl(){
		
	}

}
